package java02.bll;

public class Student {
    //静态属性-人的共同属性
    String id;
    protected String name;
    public int age;//5-35
    //静态属性-学生特有的
    private String sno;

    //动态的行为-人的共同行为
    public void eating() {
        System.out.println(this.name + "在吃饭！");
        System.out.println(sno);
        System.out.println(id);
        System.out.println(age);
    }

    //动态的行为-学生特殊行为
    public void studying() {
        System.out.println(this.name + "在学习！");
    }

    public void setAge(int age) throws Exception {
        if (age < 5 || age > 35) {
            throw new Exception("你想干啥？非法的年龄数据！");
        }
        this.age = age;
    }

    /*public Student(String sno, String name, int age) {
        this.sno = sno;
        this.name = name;
        this.age = age;
    }*/
}
